namespace AbleCommerce.Admin.Shipping.Providers.FedEx
{
    using System;
    using AblePlugins.FedEx;
    using CommerceBuilder.Shipping;
    using CommerceBuilder.Utility;

    public partial class Default : CommerceBuilder.UI.AbleCommerceAdminPage
    {
        protected void Page_Init(object sender, EventArgs e)
        {
            // DEFAULT PAGE, REDIRECT TO APPROPRIATE LOCATION
            int _ShipGatewayId = AlwaysConvert.ToInt(Request.QueryString["ShipGatewayId"]);
            ShipGateway _ShipGateway = ShipGatewayDataSource.Load(_ShipGatewayId);
            if (_ShipGateway != null)
            {
                FedExProvider provider = _ShipGateway.GetProviderInstance() as FedExProvider;
                if (provider != null)
                {
                    Response.Redirect("Configure.aspx?ShipGatewayId=" + _ShipGatewayId.ToString());
                }
            }
            Response.Redirect("Register.aspx");
        }
    }
}